package com.hdoit.kylin.logical.baseInfo.dao.impl;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tennetcn.common.dao.base.IFinderExpression;
import com.tennetcn.common.dao.base.impl.SuperDao;
import com.tennetcn.common.utils.FinderExpressionFactory;
import com.hdoit.kylin.logical.baseInfo.dao.IAcademyDao;
import com.hdoit.kylin.logical.baseInfo.mapper.AcademyMapper;
import com.hdoit.kylin.logical.baseInfo.model.Academy;
/**
* @author luozhicheng
* @email
* @createtime 2017年07月19日 15:49:43
* @comment
*/
@Component
public class AcademyDaoImpl extends SuperDao<Academy> implements IAcademyDao{
	private AcademyMapper academyMapper;
	public AcademyMapper getAcademyMapper() {
		return academyMapper;
	}
	@Resource(name = "academyMapper")
	public void setAcademyMapper(AcademyMapper academyMapper) {
		this.academyMapper = academyMapper;
	}
	public List<String> queryListBySchoolId(String schoolId){
		IFinderExpression finder = FinderExpressionFactory.createExpression();
		finder.select("schoolId")
			  .from(Academy.class)
			  .andWhere("schoolId=#{schoolId}")
			  .setParam("schoolId", schoolId);
		return queryList(finder,String.class);
	}
	
	@Override
	public List<Academy> queryList(List<String> academyIds){
		if(academyIds ==null || academyIds.size() <=0){
			return null;
		}
		return academyMapper.queryListByIds(academyIds);
	}
}